<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('user_roles', function (Blueprint $table) {
            $table->integer('role_unique_id')->comment('sdk维护角色唯一id')->unsigned()->default(0);

            $table->index('role_unique_id');
        });

        Schema::table('orders', function (Blueprint $table) {
            $table->integer('role_unique_id')->comment('sdk维护角色唯一id')->unsigned()->default(0);

            $table->index('role_unique_id');
        });

        Schema::connection('mysql_log')->table('log_user_role_login', function (Blueprint $table) {
            $table->integer('role_unique_id')->comment('sdk维护角色唯一id')->unsigned()->default(0);

            $table->index('role_unique_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
};
